package stu.info.student.info.mapper;

import org.apache.ibatis.annotations.*;
import stu.info.student.info.entity.Room;
import stu.info.student.info.entity.Student;

import java.util.List;

@Mapper
public interface roomMapper {
    /*添加房间*/
    @Insert("insert into room values(null,#{number},#{size},#{now},#{snum})")
    void insert(Room room);

    /*删除房间根据id*/
    @Delete("delete from room where rno=#{rno}")
    void deleteById(Long rno);

    /*获得房间数据*/
    @Select("select rno,number,size,now,snum from room")
    List<Room> select();

    /*根据id更新房间当前人数*/
    @Update("update room set now=#{now} where rno=#{rno}")
    void updateById(Room room);
}
